<?
	global $file,$Drafts,$img;
	$index = $Drafts->index_of($file);
	$Thumbs = $this->fmgr->open('temp:/thumbs');
?>

	var O_ID = '<?=$file->id?>';
	var USURPA = '<?=$file->usrp?>';
	var ICON = '<?=$Thumbs->uri()?>/<?=$file->id?>';
	
	Smajax.wait_threshold = 31000;
	
	window.queue(function(){
		Smernel.observe('effects.js:loaded', function(){
			File.load(<?=json_encode($file->summary(2))?>);
			Drafts.load(<?=json_encode($index)?>);
			AutoSave();											   
		});
	});
	
	function showKeyboard(){
		var s = '<div style="margin-top:-10px; background:url(<?=Screen()->icon("keyboard.png", 128)?>) 0 -10px no-repeat; text-align:right">';
		s += '<h2>Shortcuts</h2><br /><small>&ldquo;cmd&rdquo; is apply key on mac &amp; ctrl on *nix/windoze</small>';
		s += '<div style="text-align:left; margin-top:90px">';
		s += '<small>operations:</small><br />';
		s += 'cmd + <strong>s</strong> : save current<br />';
		s += 'cmd + shift + <strong>n</strong> : new draft<br />';
		s += 'cmd + shift + <strong>u</strong> : usurp<br />';
		s += '<br /><sup><em>in the meta body:</em></sup><br />';
		s += '<br /><small>history:</small><br />';
		s += 'cmd + <strong>z</strong> : undo<br />';
		s += 'cmd + shift + <strong>z</strong> : redo<br />';
		s += '<br /><small>insert:</small><br />';
		s += 'cmd + <strong>return</strong> : insert &lt;br /&gt;<br />';
		s += 'cmd + shift + <strong>d</strong> : insert &lt;div&gt;<br />';
		s += 'cmd + shift + <strong>s</strong> : insert &lt;span&gt;<br />';
		s += 'cmd + shift + <strong>e</strong> : insert &lt;em&gt;<br />';
		s += 'cmd + shift + <strong>g</strong> : insert &lt;strong&gt;<br />';
		s += '</div></div>';
		TUXalert(s);
	}
